home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Collection of Tools & Utilities
/
Collection of Tools and Utilities.iso
/
batchut
/
bcsrce2.zip
/
MRUN.BC
< prev
next >
Wrap
Text File
|
1990-10-15
|
3KB
|
107 lines
let %!a = %1
if %!a# = # Let %!d = 1
if %!a# = # goto SYNTAX
let %!z = %!a
string_length %!z
lt %!z 2
if errorlevel 1 goto input1
goto TEST1
:INPUT1
cls
gosub BASICS
locate 8 4
echonolf █ Program █
locate 9 4
echonolf █ Name is █
locate 10 4
echonolf █ Missing █
locate 15 1
echonolf Input Name of program (Ex: TYPE ):\\32
read %!a
let %!z = %!a
let %!y = %!a
if %!y = / GOTO SYNTAX2
string_length %!z
lt %!z 2
if errorlevel 1 goto input1
goto TEST1
:TEST1
let %!b = %2
if %!b# = # goto INPUT2
goto TEST2
:INPUT2
cls
locate 1 1
gosub BASICS
locate 8 4
echonolf █ Target █
locate 9 4
echonolf █ Filespec █
locate 10 4
echonolf █ Missing █
locate 15 1
echonolf Input Source filespec (Ex: ABC*.DOC):\\32
read %!b
let %!z = %!b
string_length %!z
lt %!z 3
if errorlevel 1 goto input2
goto TEST2
:TEST2
let %!z = %!b
IF NOT EXIST %!z goto ERROR
goto ACT
:BASICS
echonolf ╔══════════════════════════════════════════════════════════════════════════════╗
echonolf ║ DOS BASICS ║
echonolf ║ ║
echonolf ║ Suggested Filenaming: A-Z, underscore, 0-9, begin with letter avoid dash(-) ║
echonolf ║ Wildcards: Filenams.Ext = File????.Ex? = Fil*.E?t = F*.* = ????N*.??t = *.* ║
echonolf ║ Directory Anatomy: C:\DIR\SUBDIR\SUBDIR2\Filespec.Ext ║
echonolf ║ ╔════════════════╗ │ │ ├──────┘ └─Name of file(s) and Extension ║
echonolf ║ ║ ║ │ │ └─Subdirectories with required "\" divider ║
echonolf ║ ║ ║ │ └─1st Level directory preceded with required ":\" ║
echonolf ║ ║ ║ └─Drive identifier A-E unless Network loaded then A-Z ║
echonolf ╚═╩════════════════╩═══════════════════════════════════════════════════════════╝
return
goto END
:ACT
let %!y = %!b
for %j in (%!y) do gosub ACTON %j
goto END
:ACTON
gosub_parameter %!g
!%!a %!g
return
:SYNTAX
cls
echo SYNTAX---: MRUN [Program] [Filespec·to·process]
echo USAGE----: On any filespec entered, the inputted program is ran.
echo If any of the two parameters are missing they are prompted
echo for and tested. Program name must be 2 characters or more.
echo. Existance of Filespec is verified. If prompted for Program
echo. name, enter a '/' or Ctrl-C to abort this utility.
echo.
echo EXAMPLE--: MRUN TYPE *.TXT
echo.
echo.
IF %!a = / GOTO END
IF %!d = 1 GOSUB PROG
IF %!d = 1 GOTO INPUT1
goto END
:SYNTAX2
echo.
echo SYNTAX---: MRUN [Program] [Filespec·to·process]
goto END
:PROG
ECHO Wait 4 seconds then input [Program] name.
WAIT 4
RETURN
:ERROR
echo Unable to verify existance of Source Filespec %!a
echo Or, something wrong with program's name.
waitkey 3
goto SYNTAX
:END